#include "ServerSocket.h"
#include "SocketException.h"
#include <string>


using namespace std;

int main (int argc,char* argv[]){

int nb=0,nb2=0;
string msg="",msg2;

cout << "Serveur demarré...\n";

cout << "  .-.     .-.     .-.             .-.     .-.     .-. \n";
cout << ".'   `._.'   `._.'   `. SERVEUR .'   `._.'   `._.'   `._ \n\n";

try{
	// Creation du socket du serveur
    ServerSocket server(30003);
    ServerSocket new_sock;
    server.accept(new_sock);
    
while(true){    

	
	new_sock >> msg ;
	new_sock << "cool" ;
	
	new_sock >> msg2 ;
	cout << "Message : " << msg <<endl;	
	cout << "Message 2 : " << msg2 <<endl;	
	
/*	
	new_sock >> nb;
		cout << "Nombre : " << nb <<endl;
	new_sock << "Cool";
	new_sock >> nb2;
	cout << "Nombre : " << nb <<endl;
	cout << "Nombre 2 : " << nb2 <<endl;
/*	
	new_sock >> nb;
	cout << "Nombre : " << nb <<endl;
	
	new_sock >> nb;
	cout << "Nombre : " << nb <<endl;
*/
}	
	
}catch(SocketException& e) {
	cout << "Exception was caught: " << e.description() << "\nArret d'urgence :)\n";
}

}
